package ch.fhnw.qualiscan.api.output;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "link")
public class LinkOutput implements Serializable {
    
	private static final long serialVersionUID = 1173963150746235797L;
	private String relationship;
    private String href;

    public LinkOutput(){}

    public LinkOutput(String relationship, String href) {
        this.relationship = relationship;
        this.href = href;
    }

    @XmlAttribute(name = "rel")
    public String getRelationship() {
        return relationship;
    }

    public void setRelationship(String relationship) {
        this.relationship = relationship;
    }

    @XmlAttribute
    public String getHref(){
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder("<");
        builder.append(href).append(">; rel=").append(relationship);
        return builder.toString();
    }

}